package com.lepan.ovgms.user;

import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.View;

import com.lepan.ovgms.R;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by pc on 2016/4/28.
 */
public class UserActivity extends Activity {

    public static void startUserActivity(Context context) {
        Intent intent = new Intent(context, UserActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user);
        ButterKnife.bind(this);
    }

    @OnClick(R.id.rl_back)
    public void finish(View view) {
        finish();
    }

    @OnClick(R.id.bt_ok)
    public void showDialog(View view) {
        showDialog();
    }

    private void showDialog() {
        AlertDialog.Builder builder = new AlertDialog.Builder(
                UserActivity.this);
        builder.setTitle("提示");
        builder.setMessage("约车申请已提交成功，请等待批示！");
        builder.setIcon(R.drawable.ic_info_black_24dp);
        builder.setCancelable(false);
        builder.setPositiveButton("知道了！", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.cancel();
            }
        });
        builder.create().show();
    }
}
